import { defHttp } from '@/utils/http/axios';
import { AddGraduatingInstitution, EditGraduatingInstitution, GraduatingInstitution, UpdGraduatingInstitutionDisable } from './type';



enum Api {
    getGraduatingInstitution = '/admin/custom/college/list',
    addGraduatingInstitution = '/admin/custom/college/add',
    editGraduatingInstitution = '/admin/custom/college/update',
    graduatingInstitutionEnable = '/admin/custom/college/disable/set',
    delGraduatingInstitution = '/admin/custom/college/del'
}

/**
 * @description 查询毕业院校
 * @date
 * @export
 * @param
 */
export function getGraduatingInstitution(params: any) {
    return defHttp.get<GraduatingInstitution[]>({
        url: Api.getGraduatingInstitution,
        params
    });
}

/**
 * 新增毕业院校
 * @param data 
 * @returns 
 */
export function addGraduatingInstitution(data: AddGraduatingInstitution) {
    return defHttp.post({
        url: Api.addGraduatingInstitution,
        data
    });
}

/**
 * 修改毕业院校
 * @param data 
 * @returns 
 */
export function editGraduatingInstitution(data: EditGraduatingInstitution) {
    return defHttp.post({
        url: Api.editGraduatingInstitution,
        data
    });
}

/**
 * 禁用启用毕业院校
 * @param data 
 * @returns 
 */
export function graduatingInstitutionEnable(data: UpdGraduatingInstitutionDisable) {
    return defHttp.post({ url: `${Api.graduatingInstitutionEnable}`, data });
}

/**
 * 删除毕业院系
 * @param id 
 * @returns 
 */
export function delGraduatingInstitution(id: number) {
    return defHttp.post({ url: `${Api.delGraduatingInstitution}/${id}` });
}